<%= form_for @lookbook, :url => "" do |f| %>
  <% if @lookbook.errors.any? %>
     <p class="err_message">
      <% @lookbook.errors.full_messages.each do |msg| %> 
        <span><%= msg %></span>
      <% end %>
      </p>
  <% else %>
     <p class="err_message"></p>  
  <% end %>

<script>

$(function() {
	$("#datepicker").datepicker({
		showOn: "button",
		buttonImage: "/admin/images/date_icon.png",
		buttonImageOnly: true,
		dateFormat: "yy-mm-dd"
	});
});
</script>
					
		<p class="name">Заголовок</p>
		<%= f.text_field( :title, :class => 'input')%> 		
		
		<p class="name">Инфо</p>
		<%= f.text_area( :info, :class => 'textarea')%> 

		<p class="name">Фон</p>
		<div class="element">
			  <%if (@lookbook.background.url != "/images/missing.png")%>
		 		<%= image_tag(@lookbook.background.url(:small), :class => "photo") %>
			  <%end%>
			  <%= f.file_field( :background, :class => 'file') %>
		</div>	

		<p class="name">Картинка</p>
		<div class="element">
			  <%if (@lookbook.picture.url != "/images/missing.png")%>
		 		<%= image_tag(@lookbook.picture.url(:small), :class => "photo") %>
			  <%end%>
			  <%= f.file_field( :picture, :class => 'file') %>
		</div>				 

		<p class="name">Цвет фона (#eff5d9)</p>
		<%= f.text_field( :bgcolor, :class => 'input')%>
		
		<p class="name">Сортировка</p>
		<%= f.text_field( :sort, :class => 'input')%> 				

		
		<a class="button" href="#" onclick="$('form').submit(); return false;">Сохранить</a>
<% end %>